#ifndef AVALON_HTTPMETHOD_HPP
#define AVALON_HTTPMETHOD_HPP
#include "Avalon/Base/Enumerator.hpp"
#include "Avalon/WebServices/WebServices.hpp"

namespace Avalon {
namespace WebServices {

  /*! \struct HttpMethodDefinition
   *  \brief Enumerates HTTP methods.
   */
  struct HttpMethodDefinition {
    enum Type {

      //! HEAD method.
      HEAD,

      //! GET method.
      GET,

      //! POST method.
      POST,

      //! PUT method.
      PUT,

      //! DELETE method.
      DELETE,

      //! TRACE method.
      TRACE,

      //! OPTIONS method.
      OPTIONS,

      //! CONNECT method.
      CONNECT,

      //! PATCH method.
      PATCH
    };

    //! Parses an HttpMethod from a string.
    /*!
      \param source The string to parse.
      \return The corresponding HttpMethod.
    */
    static Type ParseString(const std::string& source);

    //! Returns the name of this method.
    const std::string& ToString() const;
  };
  typedef Enumerator<HttpMethodDefinition> HttpMethod;
}
}

#endif // AVALON_HTTPMETHOD_HPP
